package edu.hunan.cxb18.spring.aop.config.advice;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

import java.util.Arrays;

/**
 * @author chenheng
 * @create 2020-03-19 10:03
 */
public class myAdvice {
    public void before(){
        System.out.println("前置通知");
    }
    /*
     * 环绕通知
     * */
    public void around(ProceedingJoinPoint point) throws Throwable {
        System.out.println("环绕通知前。。。。。");
        point.proceed();
        System.out.println("环绕通知后。。。。。。");
    }
    public void after(){

        System.out.println("后置通知");
    }
    public void afterReturning(JoinPoint j,Object rvt){
        System.out.println("返回结果"+rvt);
        System.out.println("方法名" + j.getSignature().getName());
        System.out.println("目标参数：" + Arrays.toString(j.getArgs()) + "\n\n");
    }
}
